﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CCWin;
namespace UI
{
    public partial class LoginForm : Skin_DevExpress
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void skinLabel3_Click(object sender, EventArgs e)
        {

        }

        private void skinButton1_Click(object sender, EventArgs e)
        {
            int uid = Convert.ToInt32(textbox_uid.Text);
            string pwd = textbox_pwd.Text;
            Model.UserInfo userinfo=new Model.UserInfo();
            userinfo.Uid=uid;
            userinfo.Password=pwd;
      
            int logre = BLL.UserManager.Login(userinfo);
            if (logre == 1)
            {
                /**********************************************8*****
                   * 登录成功 初始化全局变量
                   * 
                   * **************************************/
                UI.Global.uid = uid;
                ///---------------
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else {
                MessageBox.Show("账号或者密码错误！");
            }
        }
    }
}
